
/**
 * 给对象的值赋值为模糊查询并排除currentPage和pageSize
 * @param {*} json 
 */
const Op = require('sequelize').Op

const sequelizeJsonLike = (json = {}) => {
  let newJson = {}
  for (let key in json) {
    if (key != 'currentPage' && key != 'pageSize') {
      newJson[key] = {
        [Op.like]: '%' + json[key] + '%'
      }
    }
  }
  return newJson
}

module.exports = {
  sequelizeJsonLike
}